package noema.dataModel;

public class VitalSigns {
	
	private int bloodPressureMin;
	private int bloodPressureMax;
	private int heartRate;
	private int respiratoryRate;
	private float bodyTemperature;
	private float bloodOxygenation;
	
	public VitalSigns() {
		super();
	}

	public VitalSigns(int bloodPressureMin, int bloodPressureMax,
			int heartRate, int respiratoryRate, float bodyTemperature,
			float bloodOxygenation) {
		this();
		if(bloodOxygenation>1.0 || bloodOxygenation<0){
			throw new IllegalArgumentException("bloodOxygenation must be btween 0 and 1");
		}
		this.bloodPressureMin = bloodPressureMin;
		this.bloodPressureMax = bloodPressureMax;
		this.heartRate = heartRate;
		this.respiratoryRate = respiratoryRate;
		this.bodyTemperature = bodyTemperature;
		this.bloodOxygenation = bloodOxygenation;
	}

	public int getBloodPressureMin() {
		return bloodPressureMin;
	}

	public void setBloodPressureMin(int bloodPressureMin) {
		this.bloodPressureMin = bloodPressureMin;
	}

	public int getBloodPressureMax() {
		return bloodPressureMax;
	}

	public void setBloodPressureMax(int bloodPressureMax) {
		this.bloodPressureMax = bloodPressureMax;
	}

	public int getHeartRate() {
		return heartRate;
	}

	public void setHeartRate(int heartRate) {
		this.heartRate = heartRate;
	}

	public int getRespiratoryRate() {
		return respiratoryRate;
	}

	public void setRespiratoryRate(int respiratoryRate) {
		this.respiratoryRate = respiratoryRate;
	}

	public float getBodyTemperature() {
		return bodyTemperature;
	}

	public void setBodyTemperature(float bodyTemperature) {
		this.bodyTemperature = bodyTemperature;
	}

	public float getBloodOxygenation() {
		return bloodOxygenation;
	}

	public void setBloodOxygenation(float bloodOxygenation) {
		if(bloodOxygenation>1.0 || bloodOxygenation<0){
			throw new IllegalArgumentException("bloodOxygenation must be btween 0 and 1");
		}
		this.bloodOxygenation = bloodOxygenation;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + Float.floatToIntBits(bloodOxygenation);
		result = prime * result + bloodPressureMax;
		result = prime * result + bloodPressureMin;
		result = prime * result + Float.floatToIntBits(bodyTemperature);
		result = prime * result + heartRate;
		result = prime * result + respiratoryRate;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		VitalSigns other = (VitalSigns) obj;
		if (Float.floatToIntBits(bloodOxygenation) != Float
				.floatToIntBits(other.bloodOxygenation))
			return false;
		if (bloodPressureMax != other.bloodPressureMax)
			return false;
		if (bloodPressureMin != other.bloodPressureMin)
			return false;
		if (Float.floatToIntBits(bodyTemperature) != Float
				.floatToIntBits(other.bodyTemperature))
			return false;
		if (heartRate != other.heartRate)
			return false;
		if (respiratoryRate != other.respiratoryRate)
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "VitalSigns [bloodPressureMin=" + bloodPressureMin
				+ ", bloodPressureMax=" + bloodPressureMax + ", heartRate="
				+ heartRate + ", respiratoryRate=" + respiratoryRate
				+ ", bodyTemperature=" + bodyTemperature
				+ ", bloodOxygenation=" + bloodOxygenation + "]";
	}

}
